package cn.wsalix.weixin.req.entity;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.wsalix.weixin.message.req.ReqType;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_REQ_MES_IMAGE")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@XStreamAlias("xml")
public class ImageReqMsg extends BaseReqMsg {

    /**
	 * 
	 */
	private static final long serialVersionUID = -4625413534570494988L;
	@XStreamAlias("PicUrl")
	private String picUrl;
	@XStreamAlias("MediaId")
    private String mediaId;
	public ImageReqMsg() {
        super();
	}
    public ImageReqMsg(String picUrl, String mediaId) {
        super();
        this.picUrl = picUrl;
        this.mediaId = mediaId;
        setMsgType(ReqType.IMAGE);
    }

    public String getPicUrl() {
        return picUrl;
    }

    public String getMediaId() {
        return mediaId;
    }

}
